﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sripirom.Pattern.UnitTest.Core.Domain;

namespace Sripirom.Pattern.UnitTest.Model.TestCases
{
    public class UnitTestCase : BaseEntity<String>
    {
        private IList<UnitTestParameter> _paramters;
        public UnitTestCase()
        {
            _paramters = new List<UnitTestParameter>();
        }

        public UnitTestCase(IList<UnitTestParameter> testParameters)
        {
            _paramters = testParameters;
        }

        public String Name { get; set; }
        public String Description { get; set; }
        public Boolean IsError { get; set; }
        public String Ignore { get; set; }
      //  public UnitTestFunction Function { get; set; }
        public IEnumerable<UnitTestParameter> TestParameters { get { return _paramters; } }

        public void AddParameter(UnitTestParameter param) 
        {
                
            _paramters.Add(param);
        }
        public void RemoveParameter(UnitTestParameter param)
        {
            UnitTestParameter removeParam = TestParameters.FirstOrDefault(a => a == param);
            if (removeParam == null)
                throw new ArgumentOutOfRangeException("Param not found.");

            _paramters.Remove(removeParam);
        }

        protected override void Validate()
        {
            throw new NotImplementedException();
        }
    }
}
